Repository navigation
v0.4.23: webflow tools + triggers, copilot api key fix - #1723
Merged
Merged
Conversation
waleedlatif1
commented
Oct 23, 2025
Collaborator
- fix(debug-mode): remove duplicate debug mode flag (fix(debug-mode): remove duplicate debug mode flag #1714)
- feat(i18n): update translations (feat(i18n): update translations #1709)
- improvement(condition): added variable and envvar highlighting for condition input (improvement(condition): added variable and envvar highlighting for condition input #1718)
- fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data (fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data #1719)
- feat(tools): added webflow OAuth + tools (feat(tools): added webflow OAuth + tools #1720)
- feat(i18n): update translations (feat(i18n): update translations #1721)
- improvement(schedule): fix UI bug with schedule modal (improvement(schedule): fix UI bug with schedule modal #1722)
…d, add empty state when selected cell has no data (#1719) * fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data * apps/sim * renaming * remove relative import
* feat(tools): added webflow OAuth + tools * remove itemId from delete item * remove siteId * added webhook triggers + oauth scopes + site/collection selector * update sample payload for webflow triggers * cleanup * fix discord color
Contributor
|
Skipped: This PR changes more files than the configured file change limit: ( |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Comment on lines
+33
to
+38
| const response = await fetch(`https://api.webflow.com/v2/sites/${siteId}/collections`, { | ||
| headers: { | ||
| Authorization: `Bearer ${accessToken}`, | ||
| accept: 'application/json', | ||
| }, | ||
| }) |
Check failure
Code scanning / CodeQL
Server-side request forgery
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the SSRF vulnerability, we must validate/sanitize the siteId parameter before using it in the outgoing request path. The most robust solution is to restrict siteId to only allowed values:
- If possible, select the value from an explicit allow-list or lookup dictionary keyed by user input (e.g. valid site IDs for that user from your database).
- If an allow-list is impractical, restrict the format using a strict regular expression. For example, if Webflow site IDs are known to be UUIDs, only allow values matching a UUID regex. Alternatively, permit only alphanumerics and hyphens, and explicitly reject path traversal attempts (for example, deny values containing
/,\, or..).
Edit lines in the file apps/sim/app/api/tools/webflow/collections/route.ts:
- Right after reading
siteId, add a validation step: reject the request if the input does not conform to the expected format. - Optionally, add a comment/explanation for maintainers stating the SSRF prevention rationale.
No external packages need to be added; use a regular expression for format validation.
Suggested changeset
1
apps/sim/app/api/tools/webflow/collections/route.ts
| @@ -20,7 +20,14 @@ | ||
| if (!siteId) { | ||
| return NextResponse.json({ error: 'Missing siteId parameter' }, { status: 400 }) | ||
| } | ||
|
|
||
| // SSRF mitigation: Only allow siteId values matching a strict UUID pattern (Webflow site IDs are UUIDs) | ||
| // Adjust the regex if siteId format differs (e.g. only allow alphanumerics and hyphens) | ||
| if ( | ||
| typeof siteId !== 'string' || | ||
| !/^[a-f0-9-]{36}$/i.test(siteId) | ||
| ) { | ||
| return NextResponse.json({ error: 'Invalid siteId parameter' }, { status: 400 }) | ||
| } | ||
| const accessToken = await getOAuthToken(session.user.id, 'webflow') | ||
|
|
||
| if (!accessToken) { |
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.